#include "udp.h"

#include "unistd.h"
#include "stdio.h"
#include "string.h"
#include "malloc.h"

int main(int argc, char const *argv[])
{
	char tChar[20]="127.0.0.1";

	if (argc>1) strcpy(tChar, argv[1]);
		else printf("no ip add\n");

    diff_t *diff=malloc(sizeof(diff_t)+MAX_LEN_ONCE);
    memset((void *)diff,0,sizeof(diff_t)+MAX_LEN_ONCE);

	printf("#");


	int i=0;
	//UdpRoverInit(tChar);
	while(1)
	{
		UdpRoverInit(tChar);
		printf("#");
		if(UdpRoverRecieve(diff))
			printf("recv wrong or timeout\n");
		usleep(100000);

		printf("--%d--\n",++i);
		printf("%d\n", sizeof(diff_t));
	}
	printf("hello end\n");


	free(diff);
	return 0;
}